import request from '@/util/request'
import store from '@/vuex/store'

// 查询新闻数据
export function getPlanListApi(list) {
    const value = {
        pageSize: list.pageSize,
        currentPage: list.currentPage,
        appKey: '',
        appFlag: 2,
        token: store.getters.token,
        versionCode: 0,
        param: JSON.stringify(list)
    }
    return request({
        url: 'plant/getPlantList.do',
        method: 'post',
        data: value
    })
}

export function updatePlanApi(pro) {
    const value = {
        appKey: '',
        appFlag: 2,
        token: store.getters.token,
        versionCode: 0,
        param: JSON.stringify(pro),
    }
    return request({
        url: 'plan/updatePlan.do',
        method: 'post',
        data: value
    })
}
//updatePictureApi
export function updatePictureApi(pro) {
    const value = {
        appKey: '',
        appFlag: 2,
        token: store.getters.token,
        versionCode: 0,
        param: JSON.stringify(pro),
    }
    return request({
        url: 'complete/updateCheckForm.do',
        method: 'post',
        data: value
    })
}

export function lookPlanBookApi(applyCode) {
    const value = {
        appKey: '',
        appFlag: 2,
        token: store.getters.token,
        versionCode: 0,
        param: applyCode
    }
    return request({
        url: 'plan/lookPlanBook.do',
        method: 'post',
        data: value
    })
}


export function lookProvalBookApi(applyCode) {
    const value = {
        appKey: '',
        appFlag: 2,
        token: store.getters.token,
        versionCode: 0,
        param: applyCode
    }
    return request({
        url: 'plan/lookProvalBook.do',
        method: 'post',
        data: value
    })
}
//修改申请审批表
export function updateApplyFormApi(pro) {
    const value = {
        appKey: '',
        appFlag: 2,
        token: store.getters.token,
        versionCode: 0,
        param: JSON.stringify(pro),
    }
    return request({
        url: 'plan/updateApplyForm.do',
        method: 'post',
        data: value
    })
}